//
//  DeviceView.h
//  Kids
//
//  Created by LiTengFei on 14/11/26.
//  Copyright (c) 2014年 90's Technology Co.Ltd. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DeviceView.h"
@class DeviceListView;

@protocol DeviceDataSource <NSObject>

- (DeviceView*)deviceListView:(DeviceListView*)deviceListView deviceViewForDeviceListViewIndex:(NSInteger)index;

- (NSInteger)numberOfDeviceView;

- (CGFloat)deviceListView:(DeviceListView*)deviceListView heightForDeviceViewAtIndex:(NSInteger)index;
- (CGFloat)deviceListView:(DeviceListView*)deviceListView heightForHeaderViewAtIndex:(NSInteger)index;
- (CGFloat)deviceListView:(DeviceListView*)deviceListView heightForFooterViewAtIndex:(NSInteger)index;
@end

@protocol DeviceDelegate <NSObject>

- (void)deviceListView:(DeviceListView*)deviceListView didSelectDeviceAtIndex:(NSInteger)index;

@end

@interface DeviceListView : UIView

@property (nonatomic, strong) NSArray* devices;
@property (nonatomic, assign) NSInteger currentSelectIndex;
@property (nonatomic, assign) CGFloat showHeight;

@property (nonatomic, weak) id<DeviceDataSource> dataSource;
@property (nonatomic, weak) id<DeviceDelegate> delegate;

- (void)showInView:(UIView*)view;

- (void)reload;
@end
